package com.contact.util.util.search;

import com.contact.util.StringUtils;

/**
 * Model for single-column sorting
 */
public class ResultItemSort {

    private String column;
    private boolean ascending = true;

    private ResultItemSort() {
        super();
    }

    public ResultItemSort(String column, boolean ascending) {
        this();
        setColumn(column);
        setAscending(ascending);
    }

    public final boolean getAscending() {
        return ascending;
    }

    public final void setAscending(boolean ascending) {
        this.ascending = ascending;
    }

    public final String getColumn() {
        return column;
    }

    public final void setColumn(String fieldName) {
        this.column = fieldName;
    }

    public final boolean hasSort() {
        return StringUtils.hasText(column);
    }
}
